<?php
$x = 'ho';
echo $x;
// 输出换行
echo " \r\n";
echo "<br>";
echo " \r\n";
$a = 5000;
var_dump($a);
$x = 10.365;
var_dump($x);
$x=true;
$cars=array("Volvo","BMW","Toyota");
var_dump($cars);


class Car
{
    var $color;
    function __construct($color="green") {
      $this->color = $color;
    }
    function what_color() {
      return $this->color;
    }
}

function print_vars($obj) {
   foreach (get_object_vars($obj) as $prop => $val) {
     echo "\t$prop = $val\n";
   }
}

// 实例一个对象
$herbie = new Car("white");

// 显示 herbie 属性
echo "\therbie: Properties\n";
print_vars($herbie);
$x=null;
var_dump($x);


// $c = mysql_connect();
// echo get_resource_type($c)."\n";
// 打印：mysql link

$fp = fopen("01.php","w");
echo get_resource_type($fp)."\n";
// 打印：file

// $doc = new_xmldoc("1.0");
// echo get_resource_type($doc->doc)."\n";
// 打印：domxml document



define('GREETING', 'Welcome to W3Schools.com!');
echo GREETING;
echo '\n';
// echo greeting;// 报错

const SITE_URL = "www.runoob.com";
echo SITE_URL;

echo PHP_VERSION; 
echo PHP_OS;      
echo PHP_INT_MAX;  

const COLORS = [
    "Red",
    "Green",
    "Blue"
];

echo COLORS[1];


?>